package org.hzero.order.infra.repository.impl;


import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.hzero.order.domain.entity.Item;
import org.hzero.order.domain.repository.ItemRepository;
import org.hzero.order.infra.mapper.ItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;

/**
 * @author xiuiqng.Yang-Estelle-양수청
 * @date 2019/8/5 16:01
 */

/**
 * Repository Impl
 */
@Repository
public class ItemRepositoryImpl extends BaseRepositoryImpl<Item> implements ItemRepository {

    @Autowired
    private ItemMapper itemMapper;

    @Override
    public Page<Item> pageItem(Item item, PageRequest pageRequest) {
        return PageHelper.doPage(pageRequest, ()-> itemMapper.select(item));
    }
}
